Skip to content

Harden CI credentialed uploads - #78

Merged
krotname merged 2 commits into
mainfrom
codex/fix-ci-exposure-of-analysis-credentials
Jul 31, 2026
Merged

Harden CI credentialed uploads#78
krotname merged 2 commits into
mainfrom
codex/fix-ci-exposure-of-analysis-credentials

Conversation

@krotname

Copy link
Copy Markdown
Owner

Motivation

  • Prevent credential exposure to untrusted pull-request code by ensuring SonarCloud and Codecov credentials/OIDC are not available to jobs that execute mvn verify on PR branches.

Description

  • Restrict SonarCloud analysis in .github/workflows/quality.yml to run only on trusted push events (change if to github.event_name == 'push').
  • Remove job-scoped id-token: write permission from the PR-capable Maven verify job in .github/workflows/maven.yml so that OIDC is not available during PR builds.
  • Add a new codecov job in .github/workflows/maven.yml that runs only on push, performs a trusted mvn -B verify there, and then uploads coverage with OIDC; this keeps credentialed uploads isolated to trusted events.

Testing

  • Loaded both workflow files with ruby -e 'require "yaml"; ARGV.each { |f| YAML.load_file(f); puts "#{f}: ok" }' .github/workflows/quality.yml .github/workflows/maven.yml which succeeded.
  • Ran mvn -B -DskipTests validate --file pom.xml which completed with BUILD SUCCESS indicating the project validates after the changes.

Codex Task

@krotname
krotname merged commit abd8055 into main Jul 31, 2026
14 checks passed
@krotname
krotname deleted the codex/fix-ci-exposure-of-analysis-credentials branch July 31, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant